﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Linq;
using System.Net.Mime;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace VlcWebTvN8
{
    using System.IO;
    using System.Net;
    using System.Security.AccessControl;

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public WebTvServer Server { get; set; }

        public MainWindow()
        {
            InitializeComponent();

            Server= new WebTvServer();
            Server.Start();
            DataContext = this;
            //var img=System.Drawing.Image.FromFile(@"C:\Users\Steve\Desktop\VlcWebTvN8\bin\Debug\picon\png\1_0_19_2B5C_3F3_1_C00000_0_0_0.png");
            //img.Save(@"C:\Users\Steve\Desktop\VlcWebTvN8\bin\Debug\picon\png\1_0_19_2B5C_3F3_1_C00000_0_0_0.jpg",ImageFormat.Jpeg);
        }


        private void settext(string sourceFilename)
        {
            Dispatcher.Invoke(new Action(
            delegate()
            {
                textBlock1.Text = sourceFilename;
            }
        ));

        }
        private void settext2(string sourceFilename)
        {
            Dispatcher.Invoke(new Action(
                                  delegate()
                                      {
                                          textBlock2.Text = sourceFilename;
                                      }
                                  ));

        }

        private void Window_Closed(object sender, EventArgs e)
        {
            Server.Stop();
        }

    }
}
